﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BlackjackSimulator
{
    public partial class SetBet : Form
    {
        frmGameScreen main;
        int money;

        public SetBet(frmGameScreen _main, int _money)
        {
            InitializeComponent();
            main = _main;
            money = _money;
            cbbBet.SelectedIndex = 0;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            int bet = 0;
            switch (cbbBet.SelectedIndex)
            {
                case 0:
                    bet = 5;
                    break;
                case 1:
                    bet = 10;
                    break;
                case 2:
                    bet = 15;
                    break;
                case 3:
                    bet = 20;
                    break;
                case 4:
                    bet = 25;
                    break;
                case 5:
                    bet = 50;
                    break;
                case 6:
                    bet = 100;
                    break;
            }
            if (bet > money)
                MessageBox.Show("Bet must be smaller than asset!");
            else
            {
                main.wage = bet;
                this.Close();
            }
        }
    }
}
